package com.flink.flinkdemo.flat;

import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.util.Collector;

/**
 * @author zhangy on 2021/1/2
 * @description: add you description
 */
public class MyFlatMap implements FlatMapFunction<String, Tuple2> {

    @Override
    public void flatMap(String value, Collector<Tuple2> out) throws Exception {
        String[] words = value.split(" ");
        out.collect(new Tuple2(words[0],words[1]));
    }
}